/*
============================================================================
 Name        : dd_mad.h
 Author      : Jian
 Version     :
 Copyright   : GPL
 Description : dd_mad.h - header file
============================================================================
*/

#ifndef DD_MAD_H
#define DD_MAD_H

/* INCLUDES */
#include "dd_define.h"
#include "mad.h"

__DD_BEGIN_DECLS

#define __DD_PCM_LITTLE_ENDIAN

typedef struct {
    struct mad_stream stream;
    struct mad_frame  frame;
    struct mad_synth  synth;
    mad_timer_t       timeCount ;
    int               samplePerFrame ;
} dd_mad ;

dd_mad* dd_mad_create() ;

void dd_mad_destroy(dd_mad* mad) ;

/* return how many data decoded from input, or error code */
int dd_mad_decode(dd_mad* mad, const DD_BYTE* input, DD_UINT inputLen, DD_BYTE* output, DD_UINT* outputLen) ;

/* add last decode time */
DD_UINT dd_mad_add_time(dd_mad* mad, mad_timer_t* timerCounter) ;

__DD_END_DECLS

#endif  /* DD_MAD_H */

/* End of File */
